<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Document</title>
</head>

<body>
  <!-- 2.准备容器 -->
  <div id="app">
    <h1>看图</h1>
    <button v-if="activeIndex > 0" @click="activeIndex--">上一张</button><br>
    <img v-bind:src="imgList[activeIndex]" alt="" /><br>
    <button v-if="activeIndex < imgList.length-1" @click="activeIndex++">下一张</button>

  </div>

  <!-- 1。导入vue.js -->
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>

  <script>
    <!-- 3. 创建Vue实例对象 -->
    const app = new Vue({
      // < !--容器 -->
      el: "#app",
      data: {
        activeIndex: 0,
        imgList: [
          "./tu/11-00.gif",
          "./tu/11-01.gif",
          "./tu/11-02.gif",
          "./tu/11-03.gif",
          "./tu/11-04.png",
          "./tu/11-05.png",
        ],
      },

    });
  </script>
</body>

</html>